package com.umakr.ax.app.web;

import java.util.Map;

import com.umakr.ax.common.service.PluginCouponResultService;
import com.umakr.ax.common.service.PluginSignUpResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import com.umakr.ax.common.model.PluginCouponResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import com.umakr.ax.core.base.AbstractController;

/**
 * <p>
 * ${table.comment}  前端控制器
 * </p>
 *
 * @author Umakr-Code-Generator
 * @since 2017-12-30
 */
@Controller
@RequestMapping("/api/web/pluginCouponResult")
public class PluginCouponResultWebController extends AbstractController {

	@Autowired
	PluginCouponResultService pluginCouponResultService;

	@ApiOperation(value = "优惠券列表")
	@GetMapping("/listPluginCouponResult")
	@ResponseBody
	public Object listPluginCouponResult(ModelMap modelMap,@RequestParam(name = "couponId") Long couponId,@RequestParam(name = "useStatus") Integer useStatus) {
		return setSuccessModelMap(modelMap,pluginCouponResultService.listPluginCouponResult(couponId,useStatus));
	}

	/**
	 * 根据优惠券id获取优惠券的使用情况
	 * 图表使用
	 * @param modelMap
	 * @param couponId
     * @return
     */
	@ApiOperation(value = "获取优惠券使用情况")
	@GetMapping("/getCouponResultUseDetailsChartInfoById")
	@ResponseBody
	public Object getCouponResultUseDetailsChartInfoById(ModelMap modelMap,@RequestParam(name = "couponId") Long couponId) {
		return setSuccessModelMap(modelMap,pluginCouponResultService.getCouponResultUseDetailsChartInfoById(couponId));
	}

}